<template>
  <el-card class="app-container">
    <c-u-r-d-table :option="option"/>
  </el-card>
</template>

<script>

import ColumnType from '@/framework/constant/ColumnType'
import OnlineStatusEnum from '@/framework/constant/OnlineStatusEnum'
import MappingTypeEnum from '@/feature/pdt/infra/constants/MappingTypeEnum'
import { frontCategoryApi } from '@/feature/pdt/infra/api/frontCategoryApi'
import CURDTable from '@/framework/components/table/CURDTable'

export default {
  components: { CURDTable },
  data() {
    return {
      option: {
        requestApi: frontCategoryApi,
        columns: [
          {
            label: '标题',
            searchable: true,
            width: 'auto',
            required: true,
            prop: 'title'
          },
          {
            label: '类目简介',
            prop: 'intro'
          },
          {
            label: '父级类目',
            prop: 'parentId',
            type: ColumnType.SELECT
          },
          {
            label: 'ICON图片',
            prop: 'cover'
          },
          {
            label: '排序',
            prop: 'sortNum',
            type: ColumnType.NUMBER
          },
          {
            label: '状态',
            searchable: true,
            type: ColumnType.RADIO,
            hiddenInForm: true,
            options: OnlineStatusEnum,
            prop: 'status'
          },
          {
            label: '关联类型',
            prop: 'mappingType',
            type: ColumnType.SELECT,
            options: MappingTypeEnum
          },
          {
            label: 'h5地址',
            prop: 'h5Url'
          },
          {
            label: '搜索词',
            prop: 'searchKeywords'
          },
          {
            label: '前端类目IDS,逗号分割',
            prop: 'backendCatIds'
          },
          {
            label: '创建时间',
            type: ColumnType.DATETIME,
            hiddenInForm: true,
            prop: 'gmtCreate'
          },
          {
            label: '修改时间',
            type: ColumnType.DATETIME,
            hiddenInForm: true,
            prop: 'gmtModified'
          },
          {
            label: '显示位置',
            prop: 'showPos',
            type: ColumnType.NUMBER
          }
        ]
      }
    }
  },
  methods: {}
}
</script>

